package com.jk.garden1.controller;


import com.jk.garden1.entity.*;
import com.jk.garden1.service.PlaneCompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("plane")
public class PlaneCompanyController {



    @Autowired
    private PlaneCompanyService companyService;

    /**
     * 查询公司
     * @param company
     * @return
     */
    @RequestMapping("geiPlaneList")
    public Object geiPlaneList(CompanyEntity company){
        return companyService.geiPlaneList(company);
    }

    /**
     * 搜索公司
     * @param company
     * @return
     */
    @RequestMapping("geiPlane")
    public Object geiPlane(CompanyEntity company){
        return companyService.geiPlane(company);
    }

    /**
     * 新增访客存redis
     */
    @RequestMapping("addPlane")
    public void addPlane(@RequestBody Map<String,Object> param){
        companyService.addPlane(param);
    }
    /**
     * 新增访客存redis
     */
    @RequestMapping("addPlane11")
    public void addPlane11(@RequestBody Map<String,Object> param){
        companyService.addPlane11(param);
    }

    /**
     * 打印访客单（回显访客信息）
     * @param visitorid
     * @return
     */
    @RequestMapping("getListById")
    public Object getListById(Integer visitorid){
        return companyService.getListById(visitorid);
    }


//    /**
//     * 有预约（新增访客信息并存入redis）
//     * @param param
//     */
//    @RequestMapping("addAppointmentPlane")
//    public void addAppointmentPlane(@RequestBody Map<String,Object> param){
//        companyService.addAppointmentPlane(param);
//    }


    /**
     * 查询楼宇
     */

    @RequestMapping("getBuildingList")
    public Object getBuildingList(BuildingEntity building){
        return companyService.getBuildingList(building);
    }
    /**
     * 查询预约管理
     */
    @RequestMapping("selectList")
    public List<VisitorEntity>selectList(){
        return companyService.selectList();
    }
}
